/**
 * @file       IDisplay.h
 * @brief      LCD interface definition file
 * @author     Huabo Zheng
 * @date       Jan 12, 2012
 * @Copyright  2012, www.netgear.com Inc. All rights reserved.
 */

#ifndef IDISPLAY_H_
#define IDISPLAY_H_


namespace NS_LCD_AFW
{

/**
 *@class  IDisplay
 *@brief A base class to describe as the output device
 */
class IDisplay
{
public:

	/**
	 *@brief Constructor
	 */
	IDisplay();

	/**
	 *@brief Destructor
	 */
	virtual ~IDisplay();


public:

	/**
	 *@brief init the display device
	 *@details The framework will call this function to init the display device
	 *@exception none
	 *@retval    int
	 *@return    Return ERR_SUCCESS if successful, other for failure
	 *@note
	 *@attention
	 *@see
	 */
	virtual int initialize() = 0;


	/**
	 *@brief unInit the display device
	 *@details The framework will call this function before exit
	 *@exception none
	 *@retval    int
	 *@return    Return ERR_SUCCESS if successful, other for failure
	 *@note
	 *@attention
	 *@see
	 */
	virtual int unInitialize() = 0;

	/**
	 *@brief Get the width of display device
	 *@details Get the width of the device
	 *@exception none
	 *@retval    int
	 *@return    The width of device
	 *@note
	 *@attention You must call function initialize first before this
	 *@see
	 */
	virtual int getColumnSize() = 0;

	/**
	 *@brief Get the width of display device
	 *@details Get the width of the device
	 *@exception none
	 *@retval    int
	 *@return    The width of device
	 *@note
	 *@attention You must call function initialize first before this
	 *@see
	*/
	virtual int getRowSize() = 0;

	/**
	 *@brief Highlight the specified region
	 *@details Highlight the specified region
	 *@param[in] x The starting horizontal axis of the region
	 *@param[in] y The starting vertical axis of the region
	 *@param[in] width The width of the region
	 *@param[in] hight The Height of the region
	 *@exception none
	 *@retval    int
	 *@return    Return ERR_SUCCESS if successful, other for failure
	 *@note
	 *@attention You must call function initialize first before this
	 *@see
	*/
	virtual int hightlight(int x,int y,int width,int hight) = 0;


	/**
	 *@brief Cancel to highlight the specified region
	 *@details Cancel to highlight the specified region
	 *@param[in] x The starting horizontal axis of the region
	 *@param[in] y The starting vertical axis of the region
	 *@param[in] width The width of the region
	 *@param[in] hight The Height of the region
	 *@exception none
	 *@retval    int
	 *@return    Return ERR_SUCCESS if successful, other for failure
	 *@note
	 *@attention You must call function initialize first before this
	 *@see
	*/
	virtual int unHightlight(int x,int y,int width,int hight) = 0;


	/**
	 *@brief Output the string in specified region
	 *@details Output the string in specified region
	 *@param[in] x The starting horizontal axis of the region
	 *@param[in] y The starting vertical axis of the region
	 *@param[in] width The width of the region
	 *@param[in] hight The Height of the region
	 *@param[in] pszString Points to a null-terminated character string
	 *@exception none
	 *@retval    int
	 *@return    Return ERR_SUCCESS if successful, other for failure
	 *@note      If the length of the string is greater than the given range, then the extra characters will not be displayed
	 *@attention You must call function initialize first before this
	 *@see writeChar
	 *@see writeLine
	*/
	virtual int write(int x,int y,int width,int hight,const char *pszString) = 0;


	/**
	 *@brief Output a char to the specified point
	 *@details Output a char to the specified point
	 *@param[in] x The starting horizontal axis of the region
	 *@param[in] y The starting vertical axis of the region
	 *@param[in] c The char you want to output
	 *@exception none
	 *@retval    int
	 *@return    Return ERR_SUCCESS if successful, other for failure
	 *@note
	 *@attention You must call function initialize first before this
	 *@see write
	 *@see writeLine
	*/
	virtual int writeChar(int x,int y,char c) = 0;

	/**
	*@brief Output a line of characters in the specified range
	*@details Output a line of characters in the specified range
	*@param[in] x The starting horizontal axis of the range
	*@param[in] y The starting vertical axis of the range
	*@param[in] width The width of the range
	*@param[in] pszString Points to a null-terminated character string
	*@exception none
	*@retval    int
	*@return    Return ERR_SUCCESS if successful, other for failure
	*@note      If the length of the string is greater than the given range, then the extra characters will not be displayed
	*@attention You must call function initialize first before this
	*@see writeChar
	*@see write
	*/
	virtual int writeLine(int x,int y,int width,const char *pszString)= 0;

	/**
	*@brief Empty the screen within the specified range
	*@details Empty the screen within the specified range
	*@param[in] x The starting horizontal axis of the range
	*@param[in] y The starting vertical axis of the range
	*@param[in] width The width of the range
	*@param[in] hight The width of the range
	*@exception none
	*@retval    int
	*@return    Return ERR_SUCCESS if successful, other for failure
	*@note
	*@attention You must call function initialize first before this
	*@see writeChar
	*@see writeLine
	*/
	virtual int cleanScreen(int x,int y,int width,int hight) = 0;

	/**
	 *@brief  Shows  cursor on the dispay device
	 *@details Shows  cursor on the dispay device
	 *@exception none
	 *@retval    int
	 *@return    Return ERR_SUCCESS if successful, other for failure
	 *@note
	 *@attention You must call function initialize first before this
	 *@see
	 */
	virtual int showCursor()=0;

	/**
	 *@brief  Hide  cursor on the dispay device
	 *@details Hide the cursor on the dispay device
	 *@exception none
	 *@retval    int
	 *@return    Return ERR_SUCCESS if successful, other for failure
	 *@note
	 *@attention You must call function initialize first before this
	 *@see
	 */
	virtual int hideCursor()=0;

	/**
	 *@brief  Get the current cursor position
	 *@details Get the current cursor position
	 *@param[out] x The horizontal axis of the cursor
	 *@param[out] y The vertical axis of cursor
	 *@exception none
	 *@retval    int
	 *@return    Return ERR_SUCCESS if successful, other for failure
	 *@note
	 *@attention You must call function initialize first before this
	 *@see
	 */
	virtual int getCursor(int &x,int &y) = 0;

	/**
	 *@brief  set cursor position
	 *@details set  cursor to dest position
	 *@param[in] x The horizontal axis of the cursor
	 *@param[in] y The vertical axis of cursor
	 *@exception none
	 *@retval    int
	 *@return    Return ERR_SUCCESS if successful, other for failure
	 *@note
	 *@attention You must call function initialize first before this
	 *@see
	 */
	virtual int setCursor(int x,int y) = 0;


};

} /* namespace NS_LCD_AFW */
#endif /* IDISPLAY_H_ */
